package cn.edu.scau.cmi.heyonglin.client;



import java.util.Scanner;

import cn.edu.scau.cmi.heyonglin.factory.BeefFactory;
import cn.edu.scau.cmi.heyonglin.factory.ChickenFactory;
import cn.edu.scau.cmi.heyonglin.simpleFactoryMethod.Meat;
import cn.edu.scau.cmi.heyonglin.factory.MeatFactory;
import cn.edu.scau.cmi.heyonglin.factory.PorkFactory;

public class FactoryClient {

	public static void main(String[] args) {
		System.out.println("please select which kind of meat you want to eat:beef,chicken or pork:");
		Scanner s= new Scanner(System.in);
		String meatname=s.next();
		MeatFactory meatfactory = null;
		switch(meatname) {
		case "beef":{meatfactory=new BeefFactory();Meat meat=meatfactory.getMeat();meat.cook();break;}
		case "pork":{meatfactory=new PorkFactory();Meat meat=meatfactory.getMeat();meat.cook();break;}
		case "chicken":{meatfactory=new ChickenFactory();Meat meat=meatfactory.getMeat();meat.cook();break;}
		default: {System.out.println("sorry,your input is not correct!");break;}
		}
	}

}
